package com.bbg.amyam.domain.model;

import com.bbg.amyam.domain.enumtype.StateCode;
import javax.persistence.Column;
import javax.persistence.EnumType;
import javax.persistence.Enumerated;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Pattern;
import javax.validation.constraints.Size;
import org.springframework.roo.addon.javabean.RooJavaBean;
import org.springframework.roo.addon.jpa.activerecord.RooJpaActiveRecord;
import org.springframework.roo.addon.serializable.RooSerializable;
import org.springframework.roo.addon.tostring.RooToString;

@RooJavaBean
@RooToString
@RooSerializable
@RooJpaActiveRecord(finders = { "findProfilesByEmailEquals" })
public class Profile {

    @NotNull
    @Column(unique = true)
    @Pattern(regexp = "^[_A-Za-z0-9-\\+]+(\\.[_A-Za-z0-9-]+)*@[A-Za-z0-9-]+(\\.[A-Za-z0-9]+)*(\\.[A-Za-z]{2,})$")
    private String email;

    @NotNull
    @Size(max = 20)
    private String firstName;

    @NotNull
    @Size(max = 20)
    private String lastName;

    @Size(max = 20)
    private String alternateName;

    @Size(max = 60)
    private String address;

    @Size(max = 20)
    private String city;

    @Enumerated(EnumType.STRING)
    private StateCode stateCode;

    @Pattern(regexp = "[0-9]{3}-[0-9]{3}-[0-9]{4}")
    private String phone;

    private Boolean passwordResetRequired;

    private String password;

    @Size(max = 5)
    @Pattern(regexp = "[0-9]{5}")
    private String zipCode;

    private String profilePicture;
}
